import React, { Component } from 'react'

export default class Child extends Component {
  state = {
    count: 0,
  }
  render() {
    console.log('#1 render')
    return (
      <div>
        <p>Child: {this.state.count}</p>
        <button
          onClick={() => {
            this.setState({ count: this.state.count + 1 })
          }}
        >
          +1
        </button>
      </div>
    )
  }
  componentDidUpdate() {
    console.log('#2 componentDidUpdate')
    console.log(document.querySelector('p').innerHTML)
  }
}
